<?php
// <copyright file="AuthenticationType.cs" company="NQtec">
// Copyright (c) 2008, 2009 All Right Reserved, http://www.dqer.com/
// Copyright (c) 2008, 2009 All Right Reserved, http://www.nqtec.com/
//
// This source is part of the DQER library that released under the LGPL.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Victor Gatkov</author>
// <email>v.gatkov@nqtec.com</email>
// <email>info@dqer.com</email>
// <date>2008-09-11</date>
// <summary>Contains a base, abstract class for an AuthorisationPolicyProvider</summary>

class Sign {

   function Sign() {
   }

   function in($uid,$ulv) {
      global $session;
      if($session->get_uid()) return false;  // member already signed
      if($ulv<1) return false;  // account suspended
      session_regenerate_id();
      $session->set_uid($uid);
      $session->set_ulv($ulv);
      return true;
   }

   function out() {
      global $session;
      $session->set_ulv(0);
      $session->set_uid(0);
//      session_regenerate_id(); //??? new !!!
   }

   function up() {
      global $session;
//      $tuid = get_tmp_uid; // tmp pass??
      $this->in($tuid);
   }

};

?>
